package com.zhugang.week14.programme.proxy;

/**
 * @program algorithms
 * @description: TimeUsageAspect
 * @author: chanzhugang
 * @create: 2022/09/23 01:10
 */
public class TimeUsageAspect implements Aspect {
    // 统计时间的切面

    long start;

    @Override
    public void before() {
        start = System.currentTimeMillis();
    }

    @Override
    public void after() {
        var usage = System.currentTimeMillis() - start;
        System.out.format("time usage : %dms\n", usage);

    }
}